package com.itheima.stock.mapper;

import com.itheima.stock.pojo.domain.PermissionsDomain;
import com.itheima.stock.pojo.entity.SysPermission;
import com.itheima.stock.pojo.dto.PermissionsDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* @author hyx
* @description 针对表【sys_permission(权限表（菜单）)】的数据库操作Mapper
* @createDate 2024-05-22 20:50:24
* @Entity com.itheima.stock.pojo.entity.SysPermission
*/
public interface SysPermissionMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysPermission record);

    int insertSelective(SysPermission record);

    SysPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    List<PermissionsDomain> getPermissionsByMenusId(@Param("mid") Long mid);

    List<String> getPermissionsCodeByRoleId(@Param("rids") List<String> rids);

    List<PermissionsDTO> getPermissionsDTOByUId(@Param("userId") Long userId);

    List<PermissionsDTO> getPermissionsDTO();

    List<SysPermission> getPermissions();

    List<Map> getPermissionsTree();

    SysPermission getPermissionByName(@Param("name") String name);

    SysPermission getPermissionByTitle(@Param("title") String title);


    List<Long> getAllPermissionPid();

    List<Integer> getPTypeByPid(@Param("pid") Long pid);
}
